<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title>角色详情</title>
    <#include "/view/admin/head.html"/>

    <style type="text/css">
        .list-path{
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;

        }
        .table-class{
            width:80%;
            text-align: center;
            border:1px solid #afd9ee;
            margin:0 auto;
            margin-top: 50px;
        }
        table th{
            width:20%;
            background-color: #d9edf7;
            text-align: right;
        }
        table td{
            width:20%;
            text-align: left;
        }
        .go-back{
            float:right;
            margin-right: 30px;

        }
    </style>

<script type="text/javascript">
function firstFileImg() {
		//input
		var docObj = document.getElementById("firstFile");
		//img
		var imgObjPreview = document.getElementById("firstImg");
		//div
		var divs = document.getElementById("localImag");
		if (docObj.files && docObj.files[0]) {
			//火狐下，直接设img属性
			imgObjPreview.style.width = '242px';
			imgObjPreview.style.height = '170px';
			//imgObjPreview.src = docObj.files[0].getAsDataURL();
			//火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
			imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
		} else {
			//IE下，使用滤镜
			docObj.select();
			var imgSrc = document.selection.createRange().text;
			var localImagId = document.getElementById("localImag");
			//必须设置初始大小
			localImagId.style.width = "242px";
			localImagId.style.height = "170px";
			//图片异常的捕捉，防止用户修改后缀来伪造图片
			try {
				localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
				localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
			} catch(e) {
				alert("您上传的图片格式不正确，请重新选择!");
				return false;
			}
			
			imgObjPreview.style.display = 'none';
			
			document.selection.empty();
		}
		return true;
	}  

function secondFileImg() {
	//input
	var docObj = document.getElementById("secondFile");
	//img
	var imgObjPreview = document.getElementById("secondImg");
	//div
	var divs = document.getElementById("localImag");
	if (docObj.files && docObj.files[0]) {
		//火狐下，直接设img属性
		imgObjPreview.style.width = '242px';
		imgObjPreview.style.height = '170px';
		//imgObjPreview.src = docObj.files[0].getAsDataURL();
		//火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
		imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
	} else {
		//IE下，使用滤镜
		docObj.select();
		var imgSrc = document.selection.createRange().text;
		var localImagId = document.getElementById("localImag");
		//必须设置初始大小
		localImagId.style.width = "242px";
		localImagId.style.height = "170px";
		//图片异常的捕捉，防止用户修改后缀来伪造图片
		try {
			localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
			localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
		} catch(e) {
			alert("您上传的图片格式不正确，请重新选择!");
			return false;
		}
		
		imgObjPreview.style.display = 'none';
		
		document.selection.empty();
	}
	return true;
}  

function thirdFileImg() {
	//input
	var docObj = document.getElementById("thirdFile");
	//img
	var imgObjPreview = document.getElementById("thirdImg");
	//div
	var divs = document.getElementById("localImag");
	if (docObj.files && docObj.files[0]) {
		//火狐下，直接设img属性
		imgObjPreview.style.width = '242px';
		imgObjPreview.style.height = '170px';
		//imgObjPreview.src = docObj.files[0].getAsDataURL();
		//火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
		imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
	} else {
		//IE下，使用滤镜
		docObj.select();
		var imgSrc = document.selection.createRange().text;
		var localImagId = document.getElementById("localImag");
		//必须设置初始大小
		localImagId.style.width = "242px";
		localImagId.style.height = "170px";
		//图片异常的捕捉，防止用户修改后缀来伪造图片
		try {
			localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
			localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
		} catch(e) {
			alert("您上传的图片格式不正确，请重新选择!");
			return false;
		}
		
		imgObjPreview.style.display = 'none';
		
		document.selection.empty();
	}
	return true;
}  


</script>  

 <script type="text/javascript">
var perms = [<#list perms as p>"${p}"<#if p_has_next>,</#if></#list>];
function disablePerms() {
	if($("input[name=super]:checked").val()=="true") {
		$(".perm-container input[type=checkbox]").attr("disabled","disabeld");
	} else {
		$(".perm-container input[type=checkbox]").removeAttr("disabled");
	}
}
$(function() {
	disablePerms();
	/* $("#jvForm").validate(); */
	$(".perm-container input[type=checkbox]").each(function() {
		var perm = $(this).val();
		var index = perm.indexOf(",");		
		if(index!=-1) {
			perm = perm.substring(0,index);
		}
		for(var i=0,len=perms.length;i<len;i++) {
			if(perms[i]==perm) {
				$(this).attr("checked",true);
				break;
			}
		}
	});
	$("input[name=isSuper]").bind("click",function(){
		disablePerms();
	});
});
</script>

<style type="text/css">
.perm-container{}
.perm-layout-1{padding:3px 0;}
.perm-layout-2{padding-left:30px;}
.perm-layout-3{padding-left:30px;}
</style>
  
    
</head>
<body>

<div class="list-path" > <span style="margin-left: 50px;"><span class="glyphicon glyphicon-home"></span> 角色详情</span></div>
    <div style="float:right;margin-right: 40px;"><a class="btn btn-info" href="${base}/role/troleList.do">返回上一级</a></div>
</div>


<div class="table-class">       
      <#if  message?? &&  message =="1" >
        <div class="alert alert-error" style="background-color: write;color: green;">           
           <font size="5"><strong>发布成功</strong></font>
        </div>
     </#if>
      <#if  message?? &&  message =="0" >
        <div class="alert alert-error" style="background-color: write;color: red;">           
           <font size="5"><strong>取消发布</strong></font>
        </div>
     </#if>
      <#if  message?? &&  message =="2" >
        <div class="alert alert-error" style="background-color: write;color: green;">           
           <font size="5"><strong>保存成功</strong></font>
        </div>
     </#if>     
      
    <table class="table table-bordered">
        <thead>

        </thead>
        <tbody>
          <form  action="${base}/role/troleSave.do?roleid=${trole.roleid!}" method="post" enctype="multipart/form-data"   id="myform" >
               <tr>
                <th>角色名称：</th>
                <td>
                  <input id="rolename" name="rolename" value="${trole.rolename!}" >                                           
                </td>
                <th></th>                                                                   
                </td>
              </tr>
               <tr>
                <th>权限：</th>
<td colspan="1" width="38%" class="pn-fcontent">
           <div class="perm-container">
           <div class="perm-layout-1">
<label><input value="" type="checkbox" name="perms"/>全部</label>
<div>
<!--    <div class="perm-layout-2">
	<label><input value="/index.do" type="checkbox" name="perms"/>首页 </label>
		<div>
		</div>
	</div> -->
	<!-- 子目录 -->
    <div class="perm-layout-2">
	<label><input value="开发人员测试用" type="checkbox" name="perms"/>开发人员测试用</label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/generate/createTable.do" type="checkbox" name="perms"/>建表语句生成 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/druid/index.html" type="checkbox" name="perms"/>性能监控 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/admin/apiTest.do" type="checkbox" name="perms"/>api测试 </label>
		</div>				
		</div>
	</div>
	<div class="perm-layout-2">
	<label><input value="系统管理" type="checkbox" name="perms"/>系统管理   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/sys/tuserList.do" type="checkbox" name="perms"/>系统用户管理-列表 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/sys/tuserEdit.do" type="checkbox" name="perms"/>系统用户管理-详情 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/sys/tuserAdd.do" type="checkbox" name="perms"/>系统用户管理-新增 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/sys/tuserDelete.do" type="checkbox" name="perms"/>系统用户管理-删除 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/sys/tuserSave.do" type="checkbox" name="perms"/>系统用户管理-保存 </label>
		</div>									
		<div class="perm-layout-3">
		<label><input value="/role/troleList.do" type="checkbox" name="perms"/>角色管理-列表 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/role/troleEdit.do" type="checkbox" name="perms"/>角色管理-详情 </label>
		</div>	
		<div class="perm-layout-3">
		<label><input value="/role/troleAdd.do" type="checkbox" name="perms"/>角色管理-新增 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/role/troleDelete.do" type="checkbox" name="perms"/>角色管理-删除 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/role/troleSave.do" type="checkbox" name="perms"/>角色管理-保存 </label>
		</div>																		
		</div>
		
		
	</div>		
	<div class="perm-layout-2">
	<label><input value="用户管理" type="checkbox" name="perms"/>用户管理    </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/userinfo/list" type="checkbox" name="perms"/>显示用户 </label>
		</div>		
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="首页管理" type="checkbox" name="perms"/>首页管理   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/advertisementimg/czjadvertisementimgList.do" type="checkbox" name="perms"/>首页baner设置 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjtemp/list.do" type="checkbox" name="perms"/>首页模块设置 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/discount/czjdiscountList.do" type="checkbox" name="perms"/>假日优惠图片设置 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjcommodity3/list.do" type="checkbox" name="perms"/>首页推荐商品管理 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjjqcb/list.do" type="checkbox" name="perms"/>首页爱车服务商品管理 </label>
		</div>								
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="评论管理" type="checkbox" name="perms"/>评论管理  </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/czjcomments/list.do" type="checkbox" name="perms"/>评论审核 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjreply/list.do" type="checkbox" name="perms"/>回复内容审核 </label>
		</div>		
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="商家管理" type="checkbox" name="perms"/>商家管理   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/czjbusiness/list.do" type="checkbox" name="perms"/>商家列表 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjcommodity/list.do" type="checkbox" name="perms"/>商品列表 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjcommodityimage/list.do" type="checkbox" name="perms"/>商品图片列表 </label>
		</div>	
		<div class="perm-layout-3">
		<label><input value="/czjcommoditytype/list.do" type="checkbox" name="perms"/>商品类型 </label>
		</div>							
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="订单管理" type="checkbox" name="perms"/>订单管理   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/czjorder/list.do" type="checkbox" name="perms"/>订单列表 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjorderdistribution/list.do" type="checkbox" name="perms"/>订单明细</label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjorderdistribution/list.do" type="checkbox" name="perms"/>订单配送信息 </label>
		</div>										
		<div class="perm-layout-3">
		<label><input value="/activity/list" type="checkbox" name="perms"/>节日活动订单</label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjtordermember/list.do" type="checkbox" name="perms"/>会员购买记录 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/czjweixinvoucher/list.do" type="checkbox" name="perms"/>微信支付凭证 </label>
		</div>
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="节日活动" type="checkbox" name="perms"/>节日活动   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/festivalact/list" type="checkbox" name="perms"/>节日活动设置 </label>
		</div>		
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="奖品管理" type="checkbox" name="perms"/>奖品管理   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/roulette/czjrouletteList.do" type="checkbox" name="perms"/>线上轮盘奖品设置 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/roulette/czjrouletteoffList.do" type="checkbox" name="perms"/>线下轮盘奖品设置 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/awarduse/czjawarduseList.do" type="checkbox" name="perms"/>中奖用户管理 </label>
		</div>				
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="会员管理" type="checkbox" name="perms"/>会员管理   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/sorting/hyjg" type="checkbox" name="perms"/>设置会员价格 </label>
		</div>		
		</div>
	</div>	
	<div class="perm-layout-2">
	<label><input value="链接访问量" type="checkbox" name="perms"/>链接访问量   </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/advert/advertcount_list" type="checkbox" name="perms"/>首页banner访问量监控 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/mon/monitor_list" type="checkbox" name="perms"/>出行助手访问量监控 </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/other/list" type="checkbox" name="perms"/>第三方访问量监控 </label>
		</div>				
		</div>
	</div>
	<div class="perm-layout-2">
	<label><input value="我的商品" type="checkbox" name="perms"/>我的商品  </label>
		<div>
		<div class="perm-layout-3">
		<label><input value="/busin/list" type="checkbox" name="perms"/>商品管理  </label>
		</div>
		<div class="perm-layout-3">
		<label><input value="/businorder/list" type="checkbox" name="perms"/>订单管理 </label>
		</div>		
		</div>
	</div>																
           </div>
         </div>						
        </div>
              <script type="text/javascript">
$(function() {
	$(".perm-container input[type=checkbox]").bind("click",function() {
		parentCheck(this);
		childCheck(this);
	});
});
function parentCheck(chk) {
	var obj = $(chk).parent().parent().parent();
	while(obj && obj.attr("class").indexOf("perm-container")==-1) {
		if(chk.checked) {
			$(obj.children()[0]).children().attr("checked",true);
		}
		obj = obj.parent();
	}
}
function childCheck(chk) {
	$(chk).parent().next().children().find("input[type=checkbox]").each(function(){this.checked=chk.checked});
}
</script>  
           </td>

                  
 
                          
     </form>   

       <tr>
            <td colspan="4" width="100%" style="text-align: center;">

                <a class="btn btn-success  approve-btn btn-approve" href="javascript:submitVoteOrder()">&nbsp;提交&nbsp;</a>
                <span >&nbsp;</span>   
            </td>
        </tr>



        </tbody>
    </table>

</div>

<script type="text/javascript">
   

  //提交图片
  function submitVoteOrder(){
	  	        	
	         document.getElementById("myform").submit(); 
	  	  	  	  	  	  	 
  }
  
  
  function isInteger(obj) {
   return obj%1 === 0
  }
  isInteger(3) // true
  isInteger(3.3) // false　
     
  

  
  
</script>

</body>
</html>